package it.alb.calcolatrice;

import com.example.calcolatrice.R;

import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Gravity;
import android.widget.Toast;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

public class SetDefaultConfig extends Activity {
	
	SharedPreferences settings;
	Context ctx;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_set_default_config);
		
		ctx = getApplicationContext();
		
        settings = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
        boolean bkg_img = settings.edit().putString("bkg_img", "noImg").commit();
        boolean bkg_color = settings.edit().putString("bkg_color", "#0").commit();
        
        if(bkg_color==true && bkg_img==true){
			Toast toast = Toast.makeText(ctx, "Sfondo rimosso!", Toast.LENGTH_LONG);
			toast.setGravity(Gravity.CENTER, 0, 0);
			toast.show();
        }
        
        finish();
	}


}
